package com.gemfire.onlineretailer.domain;

/**
 * The stores which stores the items.  
 * @author Binit Datta
 */

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import com.gemstone.gemfire.DataSerializable;
import com.gemstone.gemfire.DataSerializer;

public class Store implements DataSerializable {
	  private static final long serialVersionUID = 1L;
	  private int storeCode;
	  private String storeName;
	  private Address storeAddress;
	  private String contactPerson;
	  
	public int getStoreCode() {
		return storeCode;
	}
	public void setStoreCode(int storeCode) {
		this.storeCode = storeCode;
	}
	public String getStoreName() {
		return storeName;
	}
	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}
	public Address getStoreAddress() {
		return storeAddress;
	}
	public void setStoreAddress(Address storeAddress) {
		this.storeAddress = storeAddress;
	}
	public String getContactPerson() {
		return contactPerson;
	}
	public void setContactPerson(String contactPerson) {
		this.contactPerson = contactPerson;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	@Override
	public void fromData(DataInput in) throws IOException,
			ClassNotFoundException {
	
		this.storeCode = in.readInt();
		this.storeName = in.readUTF();
		this.storeAddress = (Address) DataSerializer.readObject(in);
		this.contactPerson = in.readUTF();
		
	}
	@Override
	public void toData(DataOutput out) throws IOException {
		
		out.writeInt(this.storeCode);
		out.writeUTF(this.storeName);
		DataSerializer.writeObject(this.storeAddress, out);
		out.writeUTF(this.contactPerson);
		
	}
	  
	  

}
